// pages/test/index.js
Page({
    data: {
        envId: "cloud1-5glmr22s25150f68",
        youList: [],
        tangList: [],
        douList: [],
        value1: '',
    },
    onLoad(o) {
        // this.envId
    },
    funSelect() {
        wx.cloud.callFunction({
            name: 'quickstartFunctions',
            config: {
                env: this.data.envId
            },
            data: {
                type: 'youSelectRecord'
            }
        }).then((resp) => {
            console.log('0000', resp);
            this.setData({
                youList: resp.result.data
            });
            wx.hideLoading();
        }).catch((e) => {
            console.log(e);
            this.setData({
                showUploadTip: true
            });
            wx.hideLoading();
        });
    },
    funAdd() {
        var obj = {};
        obj.name1 = this.data.value1;
        wx.cloud.callFunction({
            name: 'quickstartFunctions',
            config: {
                env: this.data.envId
            },
            data: {
                type: 'tangSelectRecord',
                obj: obj
            }
        }).then((resp) => {
            console.log('1122', resp);
            this.setData({
                tangList: resp.result.data
            });
            wx.hideLoading();
        }).catch((e) => {
            console.log(e);
            this.setData({
                showUploadTip: true
            });
            wx.hideLoading();
        });
    },
    funModify() {
        wx.cloud.callFunction({
            name: 'quickstartFunctions',
            config: {
                env: this.data.envId
            },
            data: {
                type: 'douSelectRecord'
            }
        }).then((resp) => {
            console.log('1234', resp);
            this.setData({
                douList: resp.result.data
            });
            wx.hideLoading();
        }).catch((e) => {
            console.log(e);
            this.setData({
                showUploadTip: true
            });
            wx.hideLoading();
        });
    },
    funDelete() {
        wx.navigateTo({
            url: 'url',
        })
    }
})